
public class SchavaReader {
	String myString;
	public SchavaReader(String _string) {
		myString = _string;
	}
	
	public char readChar() {
		char c = myString.charAt(0);
		myString = myString.substring(1);
		return c;
	}
	
	public char peekChar() {
		return myString.charAt(0);
	}
	
	public boolean isEmpty() {
		return myString == null || myString.length() == 0;
	}
	
	public boolean hasNext() {
		return myString != null && myString.length() > 0;
	}
	
	public void putChar(char _c) {
		myString = _c + myString;
	}
	
	public String toString() {
		return myString;
	}
	
	public void eatWhitespace() {
		while (hasNext() && Character.isWhitespace(peekChar())) {
			readChar();
		}
	}
	
	public void eatLine() {
		while (hasNext() && peekChar() != '\n') {
			readChar();
		}
	}
}
